package com.csu54sher.basereservation.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author csu54sher
 * @since 2025-10-19
 */
@Getter
@Setter
@TableName("user")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 真实名字
     */
    @TableField("name")
    private String name;

    /**
     * 昵称，方便匿名评价
     */
    @TableField("nickname")
    private String nickname;

    /**
     * 学号/工号
     */
    @TableField("id_number")
    private String idNumber;

    /**
     * 是否为管理员
     */
    @TableField("is_admin")
    private Boolean isAdmin;

    /**
     * 学院ID
     */
    @TableField("college_id")
    private Integer collegeId;

    /**
     * 团支部名称
     */
    @TableField("department")
    private String department;

    /**
     * 联系方式,要求电话
     */
    @TableField("phone_number")
    private String phoneNumber;

    /**
     * 用户密码（BCrypt算法加密）
     */
    @TableField("password")
    private String password;

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String NICKNAME = "nickname";

    public static final String ID_NUMBER = "id_number";

    public static final String IS_ADMIN = "is_admin";

    public static final String COLLEGE_ID = "college_id";

    public static final String DEPARTMENT = "department";

    public static final String PHONE_NUMBER = "phone_number";

    public static final String PASSWORD = "password";

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
